<?php

require_once dirname(__FILE__).'/../lib/comision_academicaGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/comision_academicaGeneratorHelper.class.php';

/**
 * comision_academica actions.
 *
 * @package    sistema_estadisticas
 * @subpackage comision_academica
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class comision_academicaActions extends autoComision_academicaActions
{

	public function executeShow(sfWebRequest $request)
	{
		$this->comision = ComisionAcademicaTable::getInstance()->fetchOne($request->getParameter('id'));
		$this->forward404Unless($this->comision);
	}

	public function executeEdit(sfWebRequest $request)
	{
		$this->comision_academica = ComisionAcademicaTable::getInstance()->fetchOne($request->getParameter('id'));
		$this->form = new ComisionAcademicaForm($this->comision_academica);
	}

	public function executeActa(sfWebRequest $request)
	{
		$comision = ComisionAcademicaTable::getInstance()->find($request->getParameter('id'));
		$pdf = new sgePDF();
		$pdf->setup('Acta comisión académica');
		$pdf->setPrintHeader(false);
		$pdf->writeHtml($comision->getActa());
		$pdf->Output('comision_acta.pdf', 'D');
		
		throw new sfStopException();
	}

}
